import type { Node } from 'cc';

export const EntityIndex = {
  enemies: new Set<Node>(),
  addEnemy(n: Node) {
    this.enemies.add(n);
  },
  removeEnemy(n: Node) {
    this.enemies.delete(n);
  },
  listEnemies(): Node[] {
    return Array.from(this.enemies);
  },
};

export default EntityIndex;

